import { VagueOject } from "@/types/common";

interface ConfigType {
    devBaseUrl: string;
    prodBaseUrl: string;
    apiList: VagueOject;
    checkEnvironment(): string;
    rsaPublicKey: string;
}

export const config: ConfigType = {
    devBaseUrl: "http://127.0.0.1:9090",
    prodBaseUrl: "http://127.0.0.1:3000/api/json/prod",
    apiList: {
        index: "/home/index",//首页
    },
    checkEnvironment() {
        let url: string = ""
        switch (import.meta.env.MODE) {
            case "development":
                url = this.devBaseUrl
                break;
            case "production":
                url = this.prodBaseUrl
                break;
        }
        return url;
    },
    rsaPublicKey: `-----BEGIN PUBLIC KEY-----
    MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9eo8WIbWS5Yql06imlhrW0ZXh
    faivPavdULvYLIxIKyUaOwMPFrPuHqqBNGnYOpiPHAKL+zxk2j4u+6jhB6VK1SOD
    ccSLxIRxd0HmSDS+hBzYRf4vKc8BLlhMrYhnLmcxCc+PJIIa4DfCZnu8FfQlu/5L
    ljjpYN9kHOpHAT+xpQIDAQAB
    -----END PUBLIC KEY-----
    `
}